
cmake_minimum_required(VERSION 3.30.5)

set(${CMAKE_C_FLAGS}, "${CMAKE_C_FLAGS}")
add_library(native_app_glue STATIC
    ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)

# now build app's shared lib
set(CMAKE_CXX_STANDARD 17)

set(CMAKE_SHARED_LINKER_FLAGS
    "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")

message("pasth is ${CMAKE_SOURCE_DIR}")
include_directories(${CMAKE_SOURCE_DIR}/imgui)
include_directories(${CMAKE_SOURCE_DIR}/openal-soft/include)

add_subdirectory(imgui)
add_subdirectory(audio)



set(ALSOFT_UTILS OFF CACHE BOOL "Disable utils" FORCE)
set(ALSOFT_EXAMPLES OFF CACHE BOOL "Disable examples" FORCE)
set(ALSOFT_TESTS OFF CACHE BOOL "Disable tests" FORCE)
set(ALSOFT_BACKEND_PULSEAUDIO OFF CACHE BOOL "Disable PulseAudio" FORCE)
set(ALSOFT_BACKEND_OSS OFF CACHE BOOL "Disable OSS" FORCE)
set(ALSOFT_BACKEND_ALSA OFF CACHE BOOL "Disable ALSA" FORCE)
set(ALSOFT_BACKEND_SDL2 OFF CACHE BOOL "Disable SDL2" FORCE)
set(ALSOFT_BACKEND_WAVE OFF CACHE BOOL "Disable WAVE output" FORCE)

add_subdirectory(openal-soft)


add_library(native-activity SHARED android_main.cpp )


target_include_directories(native-activity PRIVATE
    ${ANDROID_NDK}/sources/android/native_app_glue
        include)

find_package(openal)
# add lib dependencies
target_link_libraries(native-activity
    imgui_android
        fxcc_audio
        android
        native_app_glue
    EGL
    GLESv3
    log)
